package com.jse.oo.design.pattern.structural.decorator;

import java.io.BufferedInputStream;
import java.io.FileInputStream;

/**
 * 装饰器模式： 1、有一个入口类，传递装饰的对象 2、装饰类对象有一个抽象类，这个抽象类实现接口并聚合该接口
 * 
 * @author zenghua233
 *
 */
public class IODecoratorTest {

	public static void main(String[] args) throws Exception {
		String srcFile = "F:\\opensource\\oschina\\re-javase\\src\\main\\java\\com\\jse\\oo\\design\\pattern\\structural\\adaptor\\IOAdaptorTest.java";
		try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(srcFile))) {
			// Read one byte at a time and display it
			byte byteData;
			while ((byteData = (byte) bis.read()) != -1) {
				System.out.print((char) byteData);
			}
		} catch (Exception e2) {
			e2.printStackTrace();
		}
	}
}
